import type { RouteRecordRaw } from 'vue-router'
import UserCenterView from '@/views/UserCenterView.vue'
const EntriesView = () => import('@/views/EntriesView.vue')
const EntryEditorView = () => import('@/views/EntryEditorView.vue')
const TagsView = () => import('@/views/TagsView.vue')
const SummariesView = () => import('@/views/SummariesView.vue')
const BadgesView = () => import('@/views/BadgesView.vue')
const AnalyticsView = () => import('@/views/AnalyticsView.vue')

// 用户相关的路由配置
export const userRoutes: RouteRecordRaw[] = [
  {
    path: '/user-center',
    name: 'user-center',
    component: UserCenterView,
    meta: {
      title: '个人中心',
      requiresAuth: true
    }
  },
  {
    path: '/entries',
    name: 'entries',
    component: EntriesView,
    meta: { title: '成长日志', requiresAuth: true }
  },
  { path: '/entries/new', name: 'entry-new', component: EntryEditorView, meta: { title: '新建日志', requiresAuth: true } },
  { path: '/entries/:id', name: 'entry-detail', component: EntryEditorView, meta: { title: '日志详情', requiresAuth: true } },
  { path: '/entries/:id/edit', name: 'entry-edit', component: EntryEditorView, meta: { title: '编辑日志', requiresAuth: true } },
  { path: '/tags', name: 'tags', component: TagsView, meta: { title: '标签管理', requiresAuth: true } },
  { path: '/summaries', name: 'summaries', component: SummariesView, meta: { title: 'AI 摘要', requiresAuth: true } },
  { path: '/badges', name: 'badges', component: BadgesView, meta: { title: '徽章', requiresAuth: true } },
  { path: '/analytics', name: 'analytics', component: AnalyticsView, meta: { title: '分析', requiresAuth: true } },
  // 注释掉未创建的路由
  // {
  //   path: '/account',
  //   name: 'account',
  //   component: () => import('../views/AccountView.vue'), // 懒加载
  //   meta: {
  //     title: '账户余额',
  //     requiresAuth: true
  //   }
  // }
]